Optimal. Leaf size=190 \[ \frac {2 (-1)^{3/4} a^{5/2} B \text {ArcTan}\left (\frac {(-1)^{3/4} \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}+\frac {(4+4 i) a^{5/2} (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}-\frac {2 a^2 (2 i A+B) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.45, antiderivative size = 190, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3674, 3682,
3625, 211, 3680, 65, 223, 209} \begin {gather*} \frac {(4+4 i) a^{5/2} (B+i A) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}+\frac {2 (-1)^{3/4} a^{5/2} B \text {ArcTan}\left (\frac {(-1)^{3/4} \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}-\frac {2 a^2 (B+2 i A) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 209
Rule 211
Rule 223
Rule 3625
Rule 3674
Rule 3680
Rule 3682
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (c+d x))^{5/2} (A+B \tan (c+d x))}{\tan ^{\frac {5}{2}}(c+d x)} \, dx &=-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {2}{3} \int \frac {(a+i a \tan (c+d x))^{3/2} \left (\frac {3}{2} a (2 i A+B)+\frac {3}{2} i a B \tan (c+d x)\right )}{\tan ^{\frac {3}{2}}(c+d x)} \, dx\\ &=-\frac {2 a^2 (2 i A+B) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {4}{3} \int \frac {\sqrt {a+i a \tan (c+d x)} \left (-\frac {3}{4} a^2 (4 A-3 i B)-\frac {3}{4} a^2 B \tan (c+d x)\right )}{\sqrt {\tan (c+d x)}} \, dx\\ &=-\frac {2 a^2 (2 i A+B) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)}-\left (4 a^2 (A-i B)\right ) \int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx-(i a B) \int \frac {(a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx\\ &=-\frac {2 a^2 (2 i A+B) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)}-\frac {\left (i a^3 B\right ) \text {Subst}\left (\int \frac {1}{\sqrt {x} \sqrt {a+i a x}} \, dx,x,\tan (c+d x)\right )}{d}+\frac {\left (8 a^4 (i A+B)\right ) \text {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=\frac {(4+4 i) a^{5/2} (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}-\frac {2 a^2 (2 i A+B) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)}-\frac {\left (2 i a^3 B\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a+i a x^2}} \, dx,x,\sqrt {\tan (c+d x)}\right )}{d}\\ &=\frac {(4+4 i) a^{5/2} (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}-\frac {2 a^2 (2 i A+B) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)}-\frac {\left (2 i a^3 B\right ) \text {Subst}\left (\int \frac {1}{1-i a x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=\frac {2 (-1)^{3/4} a^{5/2} B \tan ^{-1}\left (\frac {(-1)^{3/4} \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}+\frac {(4+4 i) a^{5/2} (i A+B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}-\frac {2 a^2 (2 i A+B) \sqrt {a+i a \tan (c+d x)}}{d \sqrt {\tan (c+d x)}}-\frac {2 a A (a+i a \tan (c+d x))^{3/2}}{3 d \tan ^{\frac {3}{2}}(c+d x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(456\) vs. \(2(190)=380\).
time = 7.18, size = 456, normalized size = 2.40 \begin {gather*} \frac {\left (\frac {\sqrt {2} e^{-3 i (c+d x)} \sqrt {-1+e^{2 i (c+d x)}} \sqrt {\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}} \left (\sqrt {2} B \log \left (\frac {2 e^{\frac {7 i c}{2}} \left (\sqrt {2}-i \sqrt {2} e^{i (c+d x)}+2 i \sqrt {-1+e^{2 i (c+d x)}}\right )}{B \left (-i+e^{i (c+d x)}\right )}\right )+8 (i A+B) \log \left (e^{-i c} \left (e^{i (c+d x)}+\sqrt {-1+e^{2 i (c+d x)}}\right )\right )-\sqrt {2} B \log \left (-\frac {2 i e^{\frac {7 i c}{2}} \left (-i \sqrt {2}+\sqrt {2} e^{i (c+d x)}+2 \sqrt {-1+e^{2 i (c+d x)}}\right )}{B \left (i+e^{i (c+d x)}\right )}\right )\right )}{\sqrt {-\frac {i \left (-1+e^{2 i (c+d x)}\right )}{1+e^{2 i (c+d x)}}}}-\frac {4 (7 i A+3 B+A \cot (c+d x)) \sqrt {\sec (c+d x)} (\cos (2 c)-i \sin (2 c))}{3 (\cos (d x)+i \sin (d x))^2 \sqrt {\tan (c+d x)}}\right ) (a+i a \tan (c+d x))^{5/2} (A+B \tan (c+d x))}{2 d \sec ^{\frac {7}{2}}(c+d x) (A \cos (c+d x)+B \sin (c+d x))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 619 vs. \(2 (154 ) = 308\).
time = 0.12, size = 620, normalized size = 3.26
method | result | size |
derivativedivides | \(-\frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, a^{2} \left (-9 i B \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )+3 i \sqrt {i a}\, \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )+14 i A \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )+12 A \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )+6 i \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )-3 \sqrt {i a}\, \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )+6 B \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )+6 \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )+2 A \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\right )}{3 d \tan \left (d x +c \right )^{\frac {3}{2}} \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}}\) | \(620\) |
default | \(-\frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, a^{2} \left (-9 i B \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )+3 i \sqrt {i a}\, \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )+14 i A \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )+12 A \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )+6 i \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )-3 \sqrt {i a}\, \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )+6 B \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )+6 \ln \left (\frac {2 i a \tan \left (d x +c \right )+2 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {i a}+a}{2 \sqrt {i a}}\right ) \sqrt {-i a}\, a \left (\tan ^{2}\left (d x +c \right )\right )+2 A \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\right )}{3 d \tan \left (d x +c \right )^{\frac {3}{2}} \sqrt {i a}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}}\) | \(620\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 846 vs. \(2 (144) = 288\).
time = 0.69, size = 846, normalized size = 4.45 \begin {gather*} \frac {12 \, \sqrt {2} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{5}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (i \, \sqrt {2} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{5}}{d^{2}}} d e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (-i \, A - B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (-i \, A - B\right )} a^{2}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{{\left (-i \, A - B\right )} a^{2}}\right ) - 12 \, \sqrt {2} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{5}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (-i \, \sqrt {2} \sqrt {-\frac {{\left (i \, A^{2} + 2 \, A B - i \, B^{2}\right )} a^{5}}{d^{2}}} d e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (-i \, A - B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (-i \, A - B\right )} a^{2}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{{\left (-i \, A - B\right )} a^{2}}\right ) + 4 \, \sqrt {2} {\left ({\left (8 \, A - 3 i \, B\right )} a^{2} e^{\left (5 i \, d x + 5 i \, c\right )} + 2 \, A a^{2} e^{\left (3 i \, d x + 3 i \, c\right )} - 3 \, {\left (2 \, A - i \, B\right )} a^{2} e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} + 3 \, \sqrt {\frac {4 i \, B^{2} a^{5}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (\sqrt {2} {\left (B a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + B a^{2}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} + i \, \sqrt {\frac {4 i \, B^{2} a^{5}}{d^{2}}} d e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}}{B a^{2}}\right ) - 3 \, \sqrt {\frac {4 i \, B^{2} a^{5}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (\sqrt {2} {\left (B a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + B a^{2}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} - i \, \sqrt {\frac {4 i \, B^{2} a^{5}}{d^{2}}} d e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}}{B a^{2}}\right )}{6 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{\frac {5}{2}} \left (A + B \tan {\left (c + d x \right )}\right )}{\tan ^{\frac {5}{2}}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{5/2}}{{\mathrm {tan}\left (c+d\,x\right )}^{5/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________